import { Modal } from '@douyinfe/semi-ui';
import { useDispatch } from 'react-redux';
import DepartmentDetail from './detail';
import DepartmentEdit from './edit';

const DepartmentEntityDialog = ({ open, onClose, editable = false }: any) => {
  const dispatch = useDispatch<any>();
  const persistEntity = (entity: any) => {
    // dispatch()
  };

  return (
    <Modal
      title='部门信息'
      size='medium'
      visible={open}
      // onOk={handleOk}
      onCancel={onClose}>
      {editable ? (
        <>
          <DepartmentEdit />
        </>
      ) : (
        <DepartmentDetail entity={{}} />
      )}
    </Modal>
  );
};

export default DepartmentEntityDialog;
